package com.palrevo.beackBeans.program;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import com.palrevo.beackBeans.BeansBase;
import com.palrevo.data.dao.DataException;
import com.palrevo.data.models.ProgramSchedule;
import com.palrevo.data.services.ProgramsDBService;

@SuppressWarnings("serial")
@ManagedBean(name="programsBean")
@ViewScoped
public class ProgramsBean extends BeansBase{
	
	private List<ProgramSchedule> programsSchedules = new ArrayList<ProgramSchedule>();
	
	public ProgramsBean() throws DataException{
		init();
	}
	
	public void init() throws DataException {
		if(programsSchedules == null || programsSchedules.size() == 0){
			programsSchedules = ProgramsDBService.getInstance().loadProgramsScheduleTable();
		}
	}
	
	/**
	 * 
	 * @return
	 */
	public List<ProgramSchedule> getProgramsSchedules() {
		return programsSchedules;
	}

	/**
	 * 
	 * @param programsSchedules
	 */
	public void setProgramsSchedules(List<ProgramSchedule> programsSchedules) {
		this.programsSchedules = programsSchedules;
	}

}
